package com.daydayup.learn.flink;

import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import cn.hutool.json.JSONUtil;

import java.util.ArrayList;
import java.util.List;

public class WindowTest {

    public static void main(String[] args) {
        String s = FileUtil.readString("o.json", "UTF-8");
        JSONObject json = JSONUtil.parseObj(s);
        JSONObject obj = (JSONObject)json.getByPath("obj");
        JSONArray list = (JSONArray)obj.get("list");
        List<String> arr = new ArrayList<>();
        for (Object o : list) {
            JSONObject w = (JSONObject)o;
            if ("理工类".equals(w.get("kl")) && w.getStr("bz").contains("杭州") && (w.getStr("zymc").contains("计算机") || w.getStr("zymc").contains("信息"))) {
                arr.add(w.getStr("yxmc")+" - "+w.getStr("zymc")+" - "+w.getStr("bz"));
            }
        }
        System.out.println(StrUtil.join("\n", arr));
    }
}
